import 'package:flame/components.dart';
import 'package:flutter_flame/config/AssetsName.dart';
import 'package:flutter_flame/component/SpriteEntity.dart';

class StartButtonBackground extends SpriteEntity {
  StartButtonBackground(this.parentOffsetY)
    : super(AssetsName.spriteSeedChooserButtonDisabled);
  bool enable = false;
  late double parentOffsetY;

  @override
  Future<void> onLoad() async {
    await super.onLoad();
    setSize(155.0);
    position = Vector2(198, parentOffsetY);
  }

  // 设置为可以点击
  setEnable() {
    changeSprite(AssetsName.spriteSeedChooserButton);
    enable = true;
  }

  // 设置为禁止点击
  setDisabled() {
    changeSprite(AssetsName.spriteSeedChooserButtonDisabled);
    enable = false;
  }
}
